# 1.导入库
import os
import time
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
import ddddocr


#全局属性
ocr = ddddocr.DdddOcr()  # 获取识别对象
#conn = mariadb.connect(user='root', password='Ysb@12345678', host='10.180.100.250', port=23456, database='yunjing') #连接数据库
#设置浏览器属性
browser_path='C:/Users/Administrator/AppData/Local/360ChromeX/Chrome/Application/360ChromeX.exe'
driver_path='./call/360browser_95.0.4638.69.exe'
chrome_options = Options()  #创建一个选项类
chrome_options.binary_location = browser_path  # 指定浏览器
chrome_options.add_argument('disable-blink-features=AutomationControlled')  #防止检测到自动化

def view_browser():
    # 运行前关闭浏览器的所有窗口
    print("尝试关闭多余的360急速浏览器进程")
    os.system("taskkill /im 360ChromeX.exe /f")

    # 创建浏览器对象并打开url
    driver = Chrome(executable_path=driver_path, options=chrome_options)  # 创建浏览器对象
    driver.delete_all_cookies()  # 清空cookie
    driver.get('http://10.111.11.209:8080/isc_sso/login?service=http%3A%2F%2F10.111.11.209%2Fisc-portal%2Findex.jsp%3Bjsessionid%3D6dEagOYAxOtIAiHccSltn8-W5T01n4tSE5VoJ_-e7G4Z431JcncP%21-234345567')  # 打开url
    
view_browser()

time.sleep(10000)